package edu.del.teamknowledgebase.service.code.impl;

import edu.del.teamknowledgebase.service.code.CodeSendStrategy;
import edu.del.teamknowledgebase.service.sms.SmsService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
@Slf4j
public class PhoneCodeSendStrategy implements CodeSendStrategy {
    private final SmsService smsService;

    @Override
    public boolean sendCode(String receiver, String code) {
        return smsService.sendVerificationCode(receiver, code);
    }

    @Override
    public boolean verifyCode(String receiver, String code) {
        return smsService.verifyCode(receiver, code);
    }

    @Override
    public String getType() {
        return "phone";
    }
}
